#ifndef MOVINGPOINT_H
#define MOVINGPOINT_H

#include <QPoint>
#include "stdlib.h"

//this class manages the movement of a point in space
//    right now its movement is somewhat bouncy
//    but we can eventually add different movement types (diff advance functions)
class MovingPoint
{
public:
    MovingPoint();

    void advance();//this is called until the point reaches target
    void advanceX();
    void advanceY();

    //this is called to force the point to be somewhere
    void setValue( QPoint pt );
    void setValue( QPointF pt );
    void setValue( float x, float y);
    void setValueX( float x );
    void setValueY( float y );

    //this is called to set a point to target and move toward
    void setTarget( QPoint pt );
    void setTarget( QPointF pt );
    void setTarget( float x, float y);
    void setTargetX( float x );
    void setTargetY( float y );

    //damping and attraction alter the movement patterns
    void setDamping( float d );
    void setAttraction( float a );

    QPoint getValue();
    QPoint getTarget();

private:
    QPoint value;
    QPoint target;

    float damping;// = 0.45f;
    float attraction;// = 0.2f;
    float mass;// = 1.0;

    QPoint vel;
    QPoint accel;
    QPoint force;

    bool targetingX;
    bool targetingY;
};

#endif // MOVINGPOINT_H
